import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

const routes = [
  {
    path: '/',
    name: 'Login',
    component: () => import('../views/Login.vue')
  },
  {
    path: '/signUp',
    name: 'SignUp',
    component: () => import('../views/Regist.vue')
  },
  {
    path: '/index',
    name: 'Index',
    component: () => import('../views/Index.vue'),
    children: [
      {
        path: '',
        name: 'Profile',
        component: () => import('../components/index/Profile.vue')
      },
      {
        path: 'store',
        name: 'Store',
        component: () => import('../components/index/Store.vue')
      },
      {
        path: 'product',
        name: 'Product',
        component: () => import('../components/index/Product.vue')
      },
      {
        path: 'addProduct',
        name: 'AddProduct',
        component: () => import('../components/index/AddProduct.vue')
      },
      {
        path: 'bill',
        name: 'Bill',
        component: () => import('../components/index/Bill.vue')
      }
    ]
  }
]

const router = new VueRouter({
  mode: 'hash',
  base: process.env.BASE_URL,
  routes
})

export default router
